On Element Appear
AutomatR.Web.OnElementAppear
The "On Element Appear" activity in AutomatR's Web Activities category is a container that waits for a UI element to appear, enabling you to perform multiple actions within it. This activity is particularly useful in web automation scenarios where you need to synchronize with the appearance of a specific element before proceeding with further actions.
Properties
Name | Description |
---|---|
Input | |
WebElement | Specifies the UI element variable identified by the "Find Element" or other activity. This variable represents the target element that the activity waits for. Use a Selector variable. |
Web Selector | Opens the selector window, allowing you to indicate the web element using a visual interface. |
Misc | |
Display Name | Provides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variables containing the desired display name. |
Optional | |
Delay | Specifies the amount of time (in seconds) to wait before starting the "On Element Appear" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Ex.: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1. |
Timeout | Specifies the maximum time (in seconds) to wait for the specified element to appear. If the element does not appear within this time frame, the activity throws an exception. Integer variables containing the timeout duration. Default value is defined by Common.Constants.Timeout . |
How to use:
- Drag and drop the "On Element Appear" activity onto the workflow.
- Configure the properties by specifying the target web element using either the
WebElement
or theWeb Selector
. - Optionally, configure the delay, timeout, and customize the display name.
- Add additional activities within the "On Element Appear" container to be executed when the specified element appears.
- Execute the workflow to perform actions within the specified element after it appears.
Example: Consider an example where the "On Element Appear" activity is used to wait for a "Submit" button to appear on a webpage:
On Element Appear:
Display Name: "Wait for Submit Button"
WebElement: submitButtonSelector
Timeout: 20 (seconds)
- Click Button:
Display Name: "Click Submit Button"
Button Selector: submitButtonSelector
In this example, the workflow waits for the "Submit" button to appear, and once it appears, the contained "Click Button" activity is executed to click the button.